package cn.sciento.transfer.infra.repository.impl;

import cn.sciento.core.domain.Page;
import io.choerodon.mybatis.pagehelper.PageHelper;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;
import java.util.List;
import cn.sciento.mybatis.base.impl.BaseRepositoryImpl;
import cn.sciento.transfer.domain.entity.ConsDbConfig;
import cn.sciento.transfer.domain.repository.ConsDbConfigRepository;
import cn.sciento.transfer.infra.mapper.ConsDbConfigMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ConsDbConfigRepositoryImpl extends BaseRepositoryImpl<ConsDbConfig> implements ConsDbConfigRepository {
  @Autowired
  private ConsDbConfigMapper consDbConfigMapper;
  
  public Page<ConsDbConfig> pageAndSortConsDbConfig(PageRequest pageRequest, ConsDbConfig consDbConfig) {
    return PageHelper.doPageAndSort(pageRequest, () -> this.consDbConfigMapper.listConsDbConfig(consDbConfig));
  }
  
  public ConsDbConfig selectConsDbConfig(Long consDbConfigId) {
    return this.consDbConfigMapper.selectConsDbConfig(consDbConfigId);
  }
}
